{extend name="public/basic"}
{block name="main"}
{php}$audit = ['未上传','待审核','审核不通过','审核通过'];{/php}
<form action="{:url('')}" method="get" class = "layui-form">
    <div class = "layui-col-xs3">
        <div class = "layui-form-item">
            <label class = "layui-form-label">用户名</label>
            <div class = "layui-input-block">
                <input type="text" class = "layui-input" name="username" autocomplete="off" value = "{$where['username']|default=''}"/>
            </div>
        </div>
    </div>
    <div class = "layui-col-xs3">
        <div class = "layui-form-item">
            <label class = "layui-form-label">邮箱</label>
            <div class = "layui-input-block">
                <input type="text" class = "layui-input" name="email" autocomplete="off" value = "{$where['email']|default=''}"/>
            </div>
        </div>
    </div>
    <div class = "layui-col-xs3">
        <div class = "layui-form-item">
            <label class = "layui-form-label">手机号</label>
            <div class = "layui-input-block">
                <input type="text" class = "layui-input" name="mobile" autocomplete="off" value = "{$where['mobile']|default=''}"/>
            </div>
        </div>
    </div>
    <div class = "layui-col-xs3">
        <div class = "layui-form-item">
            <label class = "layui-form-label">是否激活</label>
            <div class = "layui-input-block">
                <select name = "is_active">
                    <option value = ''>是否激活</option>
                    <option value = "0" {if condition="isset($where['is_active']) && $where['is_active'] eq 0"}checked{/if}>否</option>
                    <option value = "1" {if condition="isset($where['is_active']) && $where['is_active'] eq 1"}checked{/if}>是</option>
                </select>
            </div>
        </div>
    </div>
    <div class = "layui-col-xs3">
        <div class = "layui-form-item">
            <label class = "layui-form-label">店铺名称</label>
            <div class = "layui-input-block">
                <input type="text" class = "layui-input" name="mer_name" autocomplete="off" value = "{$where['mer_name']|default=''}"/>
            </div>
        </div>
    </div>
    <div class = "layui-col-xs3">
        <div class = "layui-form-item">
            <label class = "layui-form-label">联系人</label>
            <div class = "layui-input-block">
                <input type="text" class = "layui-input" name="contact_user" autocomplete="off" value = "{$where['contact_user']|default=''}"/>
            </div>
        </div>
    </div>
    <div class = "layui-col-xs3">
        <div class = "layui-form-item">
            <label class = "layui-form-label">实名认证</label>
            <div class = "layui-input-block">
                <select name = "aptitude1">
                    <option value = ''>实名认证状态</option>
                    {volist name="audit" id="vo" key="key"}
                    <option value="{$key}" {if condition="isset($where['aptitude1']) and $where['aptitude1'] eq $key"}selected{/if}>{$vo}</option>
                    {/volist}
                </select>
            </div>
        </div>
    </div>
    <div class = "layui-col-xs3">
        <div class = "layui-form-item">
            <label class = "layui-form-label">店铺认证</label>
            <div class = "layui-input-block">
                <select name = "aptitude2">
                    <option value = ''>店铺认证状态</option>
                    {volist name="audit" id="vo" key="key"}
                    <option value="{$key}" {if condition="isset($where['aptitude2']) and $where['aptitude2'] eq $key"}selected{/if}>{$vo}</option>
                    {/volist}
                </select>
            </div>
        </div>
    </div>
    <div class = "layui-col-xs3">
        <div class = "layui-form-item">
            <label class = "layui-form-label">押金认证</label>
            <div class = "layui-input-block">
                <select name = "aptitude3">
                    <option value = ''>押金认证状态</option>
                    {volist name="audit" id="vo" key="key"}
                    <option value="{$key}" {if condition="isset($where['aptitude3']) and $where['aptitude3'] eq $key"}selected{/if}>{$vo}</option>
                    {/volist}
                </select>
            </div>
        </div>
    </div>
    <div class = "layui-row">
        <button class = "layui-btn layui-btn-success" type="submit">查询</button>
    </div>
</form>

<table class = "layui-table">
    <thead>
        <tr>
            <th>店铺名称</th>
            <th>店铺账号</th>
            <th>店铺地址</th>
            <th>店铺联系人</th>
            <th>等级</th>
            <th>实名认证</th>
            <th>店铺认证</th>
            <th>押金认证</th>
            <th>操作</th>
        </tr>
    </thead>
    <tbody>
        {volist name="records" id="vo"}
        <tr>
            <td>{$vo.mer_name}</td>
            <td>{$vo.username}/{$vo.email}/{$vo.mobile}</td>
            <td>{$vo.province}{$vo.city}{$vo.area}{$vo.mer_address}</td>
            <td>{$vo.contact_user}/{$vo.contact}</td>
            <td>{$vo.level_name}</td>
            <td>{$audit[$vo['aptitude1']]}</td>
            <td>{$audit[$vo['aptitude2']]}</td>
            <td>{$audit[$vo['aptitude3']]}</td>
            <td>
                {if condition="$vo['aptitude1'] eq 1 or $vo['aptitude1'] eq 2"}{auth:button rules="$buttons" rule="home/merchant/audit_cert"}<i class = "layui-icon layui-icon-username" title="实名认证"></i>{/auth:button}{/if}&nbsp;
                {if condition="$vo['aptitude3'] eq 1 or $vo['aptitude3'] eq 2"}{auth:button rules="$buttons" rule="home/merchant/audit_deposit"}<i class = "layui-icon layui-icon-rmb" title="保证金认证"></i>{/auth:button}{/if}&nbsp;
                {if condition="$vo['aptitude2'] eq 1 or $vo['aptitude2'] eq 2"}{auth:button rules="$buttons" rule="home/merchant/audit_store"}<i class = "layui-icon layui-icon-auz" title="店铺认证"></i>{/auth:button}{/if}&nbsp;
            </td>
        </tr>
        {/volist}
    </tbody>
</table>
{$records->render()}
{/block}